<template>
  <div style="min-height: 500px;">
    <!-- <el-button size="mini" icon="el-icon-plus" type="primary" @click="selectOrg" round>选择抄送人</el-button>
    <div class="option">
      <el-checkbox label="允许发起人添加抄送人" v-model="config.shouldAdd"></el-checkbox>
    </div>
    <org-items v-model="select"/>
    <org-picker multiple ref="orgPicker" :selected="select" @ok="selected"/> -->
     <!-- <j-select-multi-user v-model="assignedUser"/> -->
    <user-search-select-picker ref="userRef" v-model="config.assignedUser" placeholder="请选择用户" mode="" style="width:90%"></user-search-select-picker>   
    <div class="option">
      <el-checkbox label="允许发起人添加抄送人" v-model="config.shouldAdd"></el-checkbox>
    </div>
  </div>
</template>

<script>
// import OrgPicker from "@/components/wflow/OrgPicker";
// import OrgItems from "../OrgItems";
import UserSearchSelectPicker from '@/views/wflowable/common/form/components/UserSearchSelectPicker'
export default {
  name: "CcNodeConfig.vue",
  components: {UserSearchSelectPicker},
  props:{
    config:{
      type: Object,
      default: ()=>{
        return {}
      }
    }
  },
  computed:{
    // select: {
    //   get(){
    //     return this.config.assignedUser || []
    //   },
    //   set(val){
    //     this.config.assignedUser = val
    //   }
    // }
    // assignedUser:{
    //   get(){
    //     const assignedUsers = this.config.assignedUser
    //     if(assignedUsers && assignedUsers.length > 0){
    //       return assignedUsers.join(',')
    //     }else{
    //       return ''
    //     }
    //   },
    //   set(val){
    //     this.config.assignedUser = val ? val.split(',') : []
    //   }
    // }
  },
  data() {
    return {}
  },
  methods: {
    // selectOrg() {
    //   this.$refs.orgPicker.show()
    // },
    // selected(select) {
    //   console.log(select)
    //   this.select = Object.assign([], select)
    // },
    // removeOrgItem(index){
    //   this.select.splice(index, 1)
    // }
    //选择审批人
    assignedUserChange(value){   
      this.config.assignedUser = value ? [value] : []
    },
    
  }
}
</script>

<style lang="less" scoped>
.option{
  color: #606266;
  margin-top: 20px;
  font-size: small;
}

.desc{
  font-size: small;
  color: #8c8c8c;
}
.org-item{
  margin: 5px;
}
</style>
